feat: shareable URL support for hand calculator#18
Merged
Conversation
Encode calculator state (hand, melds, dora, context options) into URL query parameters using agari-core terminal input syntax. Opening a shared link auto-populates the UI and calculates the score. - Add urlState.ts with serialize/deserialize and hand notation parser - Add Share button next to Clear that copies link to clipboard - Auto-run score calculation when loading a complete hand from URL - Clear button strips query params from address bar - i18n support for share UI strings (en/ja)
The publish-crates-io job was manually added to the autogenerated release.yml, causing dist plan --check to fail. Move it to a reusable workflow (.github/workflows/publish-crates-io.yml) and reference it in dist-workspace.toml as a custom publish job. This lets cargo-dist manage release.yml while still publishing to crates.io.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the ability to share calculator state via URL.
Clicking Share encodes the current hand, melds, dora indicators, and context options into query parameters using agari-core terminal input syntax (e.g.
?h=123m456p789s11z(111m)&w=2m&d=1m,5z&ri&t). The link is copied to the clipboard.Opening a shared URL auto-populates the UI and runs score calculation automatically if the hand is complete.
Changes
urlState.tsmodule with serialize/deserialize and hand notation parseronMount